<template>
  <div>
     <div class="desc">推荐歌单</div>
     ...
     <div class="desc">最新歌单</div>
     <NewSong v-for="item in newList" :key="item.id" :name="item.name"
     :song="item.song.artists[0].name + ' - ' + item.name"
     ></NewSong>
  </div>
</template>

<script>
import { newSongList } from '@/Api'
import NewSong from '@/components/Newsong'

export default {
  data () {
    return {
      newList: []
    }
  },
  components: {
    NewSong
  },
  created () {
    this.getNewSong()
  },

  methods: {
    async getNewSong () {
      const res = await newSongList({
        limit: 20
      })
      this.newList = res.data.result
    }
  }
}
</script>

<style scoped>
.desc{
  height: 40px;
  line-height: 40px;
  color: #fff;
  background-color: rgb(180, 0, 0);
  font-size: 15px;
  padding: 0 10px;
}
</style>
